#include "task_scheduler/task_scheduler.h"

uint64_t Scheduler::addTask(Task&& task)
{
    tasks.push(std::move(task));

    return ++nextId;
}

void Scheduler::executeAllTasks()
{
    while (!tasks.empty())
    {
        const Task& task = tasks.top();
        const_cast<Task&>(task).execute();
        tasks.pop();
    }
}

void Scheduler::clearTasks()
{
    while (!tasks.empty())
    {
        const Task& task = tasks.top();
        tasks.pop();
    }
}